﻿using OMG.Fill.Vegetable.Model.Ent;
using OMG.Fill.Vegetable.Service;
using ProjectShare;
using System.Collections.Generic;
using System.Web.Http;
namespace OMG.Fill.Vegetable.Model.UI.Controllers
{
    public class UserRoleController : ApiController
    {
        UserRoleServices userRoleServices = new UserRoleServices();
        
        //[ApiActionAuthorize("获取用户角色表T_UserRole分页列表对象操作")]
        //[ApiActionException]
        public Pager<List<UserRoleEntity>> PostPageList(UserRoleQuery query)
        {
            return userRoleServices.GetPageList(query);
        }
        //[ApiActionAuthorize("新增用户角色表T_UserRole指定对象操作")]
        //[ApiActionException]
        public ResResult<int> Post(UserRoleModel model) {
            return userRoleServices.AddInfo(model);
        }
        //[ApiActionAuthorize("修改用户角色表T_UserRole指定对象操作")]
        //[ApiActionException]
        public ResResult<int> Put(UserRoleEntity model)
        {
            return userRoleServices.UpdateInfo(model);
        }
        //[ApiActionAuthorize("删除用户角色表T_UserRole指定对象操作")]
        //[ApiActionException]
        public ResResult<int> Delete(string id)
        {
            return userRoleServices.DeleteInfo(id);
        }
        //[ApiActionAuthorize("获取用户角色表T_UserRole指定对象操作")]
        //[ApiActionException]
        public ResResult<List<UserRoleItem>> Get(string id)
        {
            return userRoleServices.GetRoleList(id);
        }
    }
}